<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
      #income{
          width: 400px;
          height: 600px;
          margin: 10% auto;
          text-align: center;
      }
    </style>
</head>
<body>
    <div id="income">
        <select name="请选择类型" >
            <option>购买食材</option>
            <option>店铺装修</option>
            <option>员工工资</option>
            <option>设备维护</option>
        </select>
        <br>
        <br>
        <div>
        <input type="text" id="in">
            <span id="span1" >请输入正确的金额</span>
        </div>
        <br>
        <br>
        <button onclick="show()">添加</button>
        <button>重置</button>
    </div>
<div></div>
</body>
<script>
    function $(id) {
        return document.getElementById(id);
    }
    function show() {
        var m1 = $("in").value;
        var msg = "请输入正确的金额";
        var t1 = /^[0-9]$/
        if (t1.test(m1)){
            $("span1").innerHTML=msg;
        }
    }

</script>
</html>